/**
 * 通用组件样式
 * 提供现代化、优美的页面样式
 */

// 卡片容器样式
.page-container {
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: calc(100vh - 60px);

  .content-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;

    &:hover {
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
      transform: translateY(-2px);
    }

    .card-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 20px;
      padding-bottom: 16px;
      border-bottom: 1px solid #e8e8e8;

      .card-title {
        font-size: 20px;
        font-weight: 600;
        color: #303133;
        display: flex;
        align-items: center;

        &::before {
          content: '';
          width: 4px;
          height: 20px;
          background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
          margin-right: 12px;
          border-radius: 2px;
        }
      }

      .card-extra {
        color: #909399;
        font-size: 14px;
      }
    }

    .card-body {
      padding: 8px 0;
    }
  }
}

// 按钮增强样式
.modern-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;

  &.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    }
  }

  &.success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    color: #ffffff;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(132, 250, 176, 0.4);
    }
  }

  &.danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #ffffff;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(250, 112, 154, 0.4);
    }
  }

  &.info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #ffffff;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(168, 237, 234, 0.4);
    }
  }
}

// 表格增强样式
.modern-table {
  .el-table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);

    th {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      color: #ffffff;
      font-weight: 600;
      padding: 16px 0;
    }

    tr {
      transition: all 0.3s ease;

      &:hover {
        background-color: #f5f7fa;
        transform: scale(1.01);
      }
    }

    td {
      padding: 14px 0;
    }
  }
}

// 表单增强样式
.modern-form {
  .el-form-item {
    margin-bottom: 24px;

    .el-form-item__label {
      font-weight: 500;
      color: #606266;
    }

    .el-input__inner,
    .el-textarea__inner {
      border-radius: 8px;
      border: 1px solid #dcdfe6;
      transition: all 0.3s ease;

      &:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
      }
    }

    .el-select {
      width: 100%;

      .el-input__inner {
        border-radius: 8px;
      }
    }
  }
}

// 统计卡片样式
.stats-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  }

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  }

  .stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
  }

  .stats-title {
    font-size: 14px;
    color: #909399;
    margin-bottom: 8px;
  }

  .stats-value {
    font-size: 28px;
    font-weight: 700;
    color: #303133;
    margin-bottom: 8px;
  }

  .stats-trend {
    font-size: 13px;

    &.up {
      color: #67c23a;
    }

    &.down {
      color: #f56c6c;
    }
  }
}

// 面包屑增强
.modern-breadcrumb {
  padding: 16px 24px;
  background: #ffffff;
  border-radius: 8px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

// 标签页增强
.modern-tabs {
  .el-tabs__item {
    padding: 12px 24px;
    font-weight: 500;
    transition: all 0.3s ease;

    &:hover {
      color: #667eea;
    }

    &.is-active {
      color: #667eea;
    }
  }

  .el-tabs__active-bar {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    height: 3px;
  }
}

// 加载动画
.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;

  .loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

// 空状态样式
.empty-state {
  text-align: center;
  padding: 60px 20px;

  .empty-icon {
    font-size: 80px;
    color: #dcdfe6;
    margin-bottom: 16px;
  }

  .empty-text {
    font-size: 16px;
    color: #909399;
    margin-bottom: 24px;
  }
}

// 渐变背景变量
$gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
$gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
$gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
$gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
$gradient-5: linear-gradient(135deg, #fa709a 0%, #fee140 100%);

// 动画效果
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

// 响应式间距
.mt-10 {
  margin-top: 10px;
}
.mt-20 {
  margin-top: 20px;
}
.mt-30 {
  margin-top: 30px;
}
.mb-10 {
  margin-bottom: 10px;
}
.mb-20 {
  margin-bottom: 20px;
}
.mb-30 {
  margin-bottom: 30px;
}
.mr-10 {
  margin-right: 10px;
}
.mr-20 {
  margin-right: 20px;
}
.ml-10 {
  margin-left: 10px;
}
.ml-20 {
  margin-left: 20px;
}
